/*     */ package com.chw.admin.sysiconinfo;
/*     */ 
/*     */ import com.chw.annotation.PermissionSecurity;
/*     */ import com.chw.common.ServiceData;
/*     */ import com.chw.common.ServiceData.RetCode;
/*     */ import com.chw.utils.LogUtil;
/*     */ import com.github.pagehelper.PageInfo;
/*     */ import com.google.gson.Gson;
/*     */ import java.util.List;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import org.springframework.beans.factory.annotation.Autowired;
/*     */ import org.springframework.stereotype.Controller;
/*     */ import org.springframework.web.bind.annotation.RequestMapping;
/*     */ import org.springframework.web.bind.annotation.ResponseBody;
/*     */ 
/*     */ @Controller
/*     */ @RequestMapping({"/sysIconInfo"})
/*     */ public class SysIconInfoController
/*     */ {
/*  23 */   private static LogUtil log = LogUtil.newInstance(SysIconInfoController.class);
/*     */ 
/*     */   @Autowired
/*     */   private ISysIconInfoService sysIconInfoService;
/*     */ 
/*  32 */   @RequestMapping(value={"/findSysIconInfo.do"}, consumes={"*/*"}, produces={"application/json"})
/*     */   @ResponseBody
/*     */   @PermissionSecurity(name="查询", module="查询图标列表", btnfunc="select_sysIconInfo")
/*     */   public ServiceData findSysIconInfo(HttpServletRequest request, SysIconInfo sysIconInfo, Integer currentPage, Integer pageSize) throws Exception { log.info("findSysIconInfo");
/*  33 */     ServiceData ret = new ServiceData();
/*     */ 
/*  35 */     PageInfo rta = this.sysIconInfoService.find(sysIconInfo, currentPage, pageSize);
/*  36 */     ret.setCode(request, ServiceData.RetCode.Success);
/*  37 */     ret.setBo(rta);
/*  38 */     return ret; }
/*     */ 
/*     */   @RequestMapping(value={"/saveSysIconInfo.do"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}, consumes={"*/*"}, produces={"application/json"})
/*     */   @ResponseBody
/*     */   @PermissionSecurity(name="新增", module="新增图标", btnfunc="add_sysIconInfo")
/*     */   public ServiceData saveSysIconInfo(HttpServletRequest request, String param) throws Exception {
/*  47 */     log.info("saveSysUploadFiles");
/*  48 */     ServiceData ret = new ServiceData();
/*  49 */     Gson gson = new Gson();
/*  50 */     SysIconInfo sysIconInfo = (SysIconInfo)gson.fromJson(param, SysIconInfo.class);
/*  51 */     int i = this.sysIconInfoService.save(sysIconInfo);
/*  52 */     ret.setCode(request, ServiceData.RetCode.Success);
/*  53 */     ret.setBo(Integer.valueOf(i));
/*  54 */     return ret;
/*     */   }
/*  62 */   @RequestMapping(value={"/updateSysIconInfo.do"}, method={org.springframework.web.bind.annotation.RequestMethod.POST}, consumes={"*/*"}, produces={"application/json"})
/*     */   @ResponseBody
/*     */   @PermissionSecurity(name="修改", module="编辑图标", btnfunc="update_sysIconInfo")
/*     */   public ServiceData updateSysIconInfo(HttpServletRequest request, String param) throws Exception { ServiceData ret = new ServiceData();
/*  63 */     Gson gson = new Gson();
/*  64 */     SysIconInfo sysIconInfo = (SysIconInfo)gson.fromJson(param, SysIconInfo.class);
/*  65 */     int i = this.sysIconInfoService.update(sysIconInfo);
/*  66 */     ret.setCode(request, ServiceData.RetCode.Success);
/*  67 */     ret.setBo(Integer.valueOf(i));
/*  68 */     return ret; }
/*     */ 
/*     */   @RequestMapping(value={"/findSysIconInfoByType.do"}, consumes={"*/*"}, produces={"application/json"})
/*     */   @ResponseBody
/*     */   @PermissionSecurity(name="查询", module="根据引用id查找图标", btnfunc="select_sysIconInfo")
/*     */   public ServiceData findSysUploadFilesByRefIdList(HttpServletRequest request, String iconShowType) throws Exception {
/*  77 */     ServiceData ret = new ServiceData();
/*  78 */     List list = this.sysIconInfoService.findByIconShowType(iconShowType);
/*  79 */     ret.setBo(list);
/*  80 */     ret.setCode(request, ServiceData.RetCode.Success);
/*  81 */     return ret;
/*     */   }
/*     */   @RequestMapping(value={"/findSysIconInfoById.do"}, consumes={"*/*"}, produces={"application/json"})
/*     */   @ResponseBody
/*     */   @PermissionSecurity(name="查询", module="根据Id查询图标", btnfunc="select_sysIconInfo")
/*     */   public ServiceData findSysIconInfoById(HttpServletRequest request, String sysIconInfoId) throws Exception {
/*  90 */     ServiceData ret = new ServiceData();
/*  91 */     SysIconInfo sysIconInfo = this.sysIconInfoService.findById(sysIconInfoId);
/*  92 */     ret.setBo(sysIconInfo);
/*  93 */     ret.setCode(request, ServiceData.RetCode.Success);
/*  94 */     return ret;
/*     */   }
/*     */   @RequestMapping(value={"/findSysIconInfoByShowType.do"}, consumes={"*/*"}, produces={"application/json"})
/*     */   @ResponseBody
/*     */   @PermissionSecurity(name="查询", module="根据Id查询图标", btnfunc="")
/*     */   public ServiceData findSysIconInfoByShowType(HttpServletRequest request, SysIconInfo sysIconInfo) throws Exception {
/* 103 */     ServiceData ret = new ServiceData();
/* 104 */     List sysIconInfoList = this.sysIconInfoService.findIconShow(sysIconInfo);
/* 105 */     SysIconInfo sysIconInfoDb = new SysIconInfo();
/* 106 */     if ((sysIconInfoList != null) && (sysIconInfoList.size() > 0)) {
/* 107 */       sysIconInfoDb = (SysIconInfo)sysIconInfoList.get(0);
/*     */     }
/* 109 */     ret.setBo(sysIconInfoDb);
/* 110 */     ret.setCode(request, ServiceData.RetCode.Success);
/* 111 */     return ret;
/*     */   }
/* 119 */   @RequestMapping(value={"/setSysIconInfoStatus.do"}, consumes={"*/*"}, produces={"application/json"})
/*     */   @ResponseBody
/*     */   @PermissionSecurity(name="编辑", module="编辑图标", btnfunc="select_sysIconInfo")
/*     */   public ServiceData setSysIconInfoStatus(HttpServletRequest request, String sysIconInfoId, String iconStatus, String iconShowType) throws Exception { ServiceData ret = new ServiceData();
/* 120 */     int i = this.sysIconInfoService.setStatus(sysIconInfoId, iconStatus, iconShowType);
/* 121 */     ret.setBo(Integer.valueOf(i));
/* 122 */     ret.setCode(request, ServiceData.RetCode.Success);
/* 123 */     return ret;
/*     */   }
/*     */ }

/* Location:           E:\chenya\2017 4-21\com.chw\admin\sysiconinfo\
 * Qualified Name:     com.chw.admin.sysiconinfo.SysIconInfoController
 * JD-Core Version:    0.6.0
 */